import sys
import os
from PySide6.QtGui import QGuiApplication
from PySide6.QtQml import QQmlApplicationEngine

if __name__ == "__main__":
    # 添加项目根目录到Python路径
    sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
    
    app = QGuiApplication(sys.argv)
    
    engine = QQmlApplicationEngine()
    engine.load(os.path.join(os.path.dirname(__file__), "ButtonExample.qml"))
    
    if not engine.rootObjects():
        sys.exit(-1)
    
    sys.exit(app.exec())